<#include "/common/head.ftl">

<@showTitle title="${i18n.getMessage('makeUpTest')} > ${i18n.getMessage('edit')}">
	<a href="#" onclick="cc('study/showListMakeUpTest.sgt?offeringId=${(offering.id)!}')">${i18n.getMessage('list')}</a>
	- <a href="#" onclick="cc('study/showTestResult.sgt?offeringId=${offering.id}')">${i18n.getMessage('result')}</a>
	- <a href="#" onclick="cc('offering/showInfoOffering.sgt?id=${(offering.id)!}')">${i18n.getMessage('offering')}</a>
</@showTitle>

<div id="error" style="display:none"></div>

<form action="study/editMakeUpTest.sgt" validator="study/validateMakeUpTest.sgt" onsubmit="submitFormValidation(this); return false;" onreset="$('error').hide()">
	<input type="hidden" name="finalTestId" value="${(finalTest.id)!}"/>
	<input type="hidden" name="offeringId" value="${(offering.id)!}"/>
		
	<table id="dataTable" cellspacing="5" align="center" cellpadding="0">
		<tr>
			<td class="name"><@required/>${i18n.getMessage('class')}:</td>
			<td><input type="text" value="${(offering.name)!}" disabled style="width:200px"/></td>
		</tr>
		<tr>
			<td class="name">${i18n.getMessage('student')}:</td>
			<td><input type="text" value="${(receipt.student.fullName)!}" disabled style="width:200px"/></td>
		</tr>
		<tr>
			<td class="name">${i18n.getMessage('testDate')}:</td>
			<td><input type="text" name="date" value="${(finalTest.makeUpTest.makeUpDate)!now?date}" style="width:200px"/><img class="calendarImg" src="images/calendar/calendar.gif" onclick="displayCalendar(document.forms[0].date, '${i18n.getMessage('format.date')}', this)"/></td>
		</tr>
		<tr>
			<td class="name">${i18n.getMessage('score')}:</td>
			<td>
				${i18n.getMessage('listening')}: <input type="text" value="${finalTest.listening!}" name="listeningScore" style="text-align:center;width:40px"/>
				${i18n.getMessage('speaking')}: <input type="text" value="${finalTest.speaking!}" name="speakingScore" style="text-align:center;width:40px"/>
			</td>
		</tr>
		<tr>
			<td class="name"></td>
			<td>
				${i18n.getMessage('grammar')}: <input type="text" value="${finalTest.grammar!}" name="grammarScore" style="text-align:center;width:40px"/>
				${i18n.getMessage('reading')}:&nbsp <input type="text" value="${finalTest.reading!}" name="readingScore" style="text-align:center;width:40px"/>
			</td>
		</tr>
		<tr>
			<td class="name"></td>
			<td>
				${i18n.getMessage('writing')}:&nbsp&nbsp <input type="text" value="${finalTest.writing!}" name="writtenScore" style="text-align:center;width:40px"/>
				<#if ge>
					${i18n.getMessage('pronun')}:&nbsp&nbsp&nbsp <input type="text" name="pronunciationScore" style="text-align:center;width:40px"/>
				</#if>
			</td>
		</tr>
		<tr>
			<td class="name">${i18n.getMessage('receiptNo')}:</td>
			<td>
				<input type="text" name="receiptNo" value="${finalTest.makeUpTest.receiptNo!}" style="width:200px"/>
			</td>
		</tr>
		
		<#assign fee = ParameterService.find('FPT').value>
		<tr>
			<td class="name">${i18n.getMessage('fee')}:</td>
			<td>
				<input type="text" name="fee" value="${finalTest.makeUpTest.fee!}" style="text-align:right;width:200px"/>
			</td>
		</tr>
		<tr>
			<td class="name">${i18n.getMessage('cashier')}:</td>
			<td>
				<select name="cashierId" style="width:204px">
					<option></option>
					<#list cashiers as cashier>
						<option value="${(cashier.id)!}" <#if (finalTest.makeUpTest.cashier)! == cashier>selected</#if>>${(cashier.fullName)!}</option>
					</#list>
				</select>
			</td>
		</tr>
		<tr>
			<td class="name" style="vertical-align:top">${i18n.getMessage('comment')}:</td>
			<td><textarea name="comment" style="width:350px;height:80px;"></textarea></td>
		</tr>
		<tr>
			<td></td>
			<td>
				<input type="submit" value="${i18n.getMessage('edit')}" class="button_style"/> 
				<input type="reset" value="${i18n.getMessage('reset')}" class="button_style"/> 
			</td>
		</tr>
	</table>
</form>